﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PPP.Model;


namespace PPP.Services {
    public class PicturesService : IPicturesService {
        public void GetPictures(Action<IList<Picture>, Exception> callback) {

            List<Picture> result = new List<Picture>();

            DirectoryInfo dir = new DirectoryInfo(@"C:\Users\admin\Documents\Visual Studio 2013\Projects\PPP\PPP\Images\Samples");
            FileInfo[] files = dir.GetFiles("*.jpg",SearchOption.AllDirectories);
            
            foreach (FileInfo fileInfo in files) {          
                result.Add(new Picture(fileInfo));
            }



            

            callback(result, null);

        }


    }
}
